package com.guojunyu.exp2.conf;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

@EnableConfigurationProperties(CustomProperties.class)
public class Exp2AutoConfig {

    @Bean
    @ConditionalOnProperty(prefix = "guojunyu.auto", name = "enable", havingValue = "true")
    CommandLineRunner createCustomerCommandLineRunner(Environment env) {
        return new CustomCommandLineRunner(env);
    }

}
